home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / PredatorPrey / EditM.c < prev    next >
Text File  |  1996-06-22  |  4KB  |  188 lines

  1. /* EditM.c */
  2. /* Created 930522 09:34 AM by AppMaker */
  3.  
  4. #include <Types.h>
  5. #include <Quickdraw.h>
  6. #include <Controls.h>
  7. #include <Dialogs.h>
  8. #include <Editions.h>
  9. #include <Events.h>
  10. #include <Lists.h>
  11. #include <Menus.h>
  12. #include <TextEdit.h>
  13. #include "ResourceDefs.h"
  14. #include "DoScrap.h"
  15. #include "Globals.h"
  16. #include "EditM.h"
  17.  
  18.  
  19. static void        DoUndo (void);
  20. static void        DoCut (void);
  21. static void        DoCopy (void);
  22. static void        DoPaste (void);
  23. static void        DoClear (void);
  24. /*static void        DoSelectAll (void);*/
  25. /*static void        DoCreatePublisher (void);*/
  26. /*static void        DoSubscribeTo (void);*/
  27. /*static void        DoSubscriberOptions (void);*/
  28. /*static void        DoShowClipboard (void);*/
  29.  
  30. void editM_seg() {}        /*  for reference in "UnloadSeg()" calls    */
  31.  
  32.  
  33. /*----------*/
  34. void InitEditM ()
  35. {
  36. } /*InitEditM*/
  37.  
  38. /*----------*/
  39. static void DoUndo (void)
  40. {
  41. } /*DoUndo*/
  42.  
  43. /*----------*/
  44. static void DoCut (void)
  45. {
  46. } /*DoCut*/
  47.  
  48. /*----------*/
  49. static void DoCopy (void)
  50. {
  51. } /*DoCopy*/
  52.  
  53. /*----------*/
  54. static void DoPaste (void)
  55. {
  56. } /*DoPaste*/
  57.  
  58. /*----------*/
  59. static void DoClear (void)
  60. {
  61. } /*DoClear*/
  62.  
  63. /*----------*/
  64. static void DoSelectAll (void)
  65. {
  66. } /*DoSelectAll*/
  67.  
  68. /*----------*/
  69. static void DoCreatePublisher (void)
  70. {
  71. #if 0
  72.     OSErr                theErr;
  73.     NewPublisherReply    pdReply;
  74.  
  75. #include <Packages.h>
  76.     pdReply.usePart = false;
  77.     pdReply.preview = nil;                /*should be handle to and*/
  78.     pdReply.previewFormat = 'TEXT';        /*type of preview data*/
  79.  
  80.     /* fill in pdReply.container: */
  81.     HLock ((Handle)cur->filename);
  82.     theErr = FSMakeFSSpec(cur->volNum, 0L /*dirID*/, *cur->filename,
  83.                           &pdReply.container.theFile);
  84.                                 /*should really pass default edition name*/
  85.                                 /*instead of cur->filename*/
  86.     HUnlock ((Handle)cur->filename);
  87.     if (theErr == noErr) {        /* FSMakeFSSpec went ok */
  88.         pdReply.container.theFileScript = iuCurrentScript;
  89.                                             /* should be script code for cur->filename */
  90.         pdReply.container.thePart = kPartsNotUsed;
  91.         pdReply.container.thePartName[0] = 0;        /* not used */
  92.         pdReply.container.thePartScript = 0;        /* not used */
  93.  
  94.         theErr = NewPublisherDialog (&pdReply);
  95.         if ((theErr == noErr) && (!pdReply.canceled)) {
  96.             /* handle new publisher */
  97.         } /* otherwise, NewPublisherDialog error or user cancelled */
  98.     } else {
  99.         /* handle FSMakeFSSpec error */
  100.     }
  101. #endif
  102. } /*DoCreatePublisher*/
  103.  
  104. /*----------*/
  105. static void DoSubscribeTo (void)
  106. {
  107.     OSErr                theErr;
  108.     NewSubscriberReply    sdReply;
  109.  
  110.     sdReply.formatsMask = kTEXTformatMask;
  111.     theErr = GetLastEditionContainerUsed (&sdReply.container);
  112.     theErr = NewSubscriberDialog (&sdReply);
  113.     if (!sdReply.canceled) {
  114.         /* handle subscriber to */
  115.     }
  116. } /*DoSubscribeTo*/
  117.  
  118. /*----------*/
  119. /* This procedure displays either the publisher options or */
  120. /* subscriber options dialog, depending on what's selected. */
  121. /*----------*/
  122. static void DoSubscriberOptions (void)
  123. {
  124.     OSErr                theErr;
  125.     SectionOptionsReply    soReply;
  126.  
  127.     theErr = SectionOptionsDialog (&soReply);
  128.     if ((theErr == noErr) && (!soReply.canceled)) {
  129.         switch (soReply.action) {
  130.             case 'read':        /* "Get Edition Now" */
  131.                 break;
  132.             case 'writ':        /* "Send Edition Now" */
  133.                 break;
  134.             case 'goto':        /* "Open Publisher" */
  135.                 break;
  136.             case 'cncl':        /* "Cancel Publisher/Subscriber" */
  137.                 break;
  138.             case '    ':        /* "OK" */
  139.                 break;
  140.         } /* switch */
  141.     }
  142. } /*DoSubscriberOptions*/
  143.  
  144. /*----------*/
  145. static void DoShowClipboard (void)
  146. {
  147. } /*DoShowClipboard*/
  148.  
  149. /*----------*/
  150. void DoEdit    (short        itemNr)
  151. {
  152.     switch (itemNr) {
  153.         case EditUndo:
  154.                 DoUndo ();        /*    this    */
  155.             break;
  156.         case EditCut:
  157.                 DoCut ();        /*    this    */
  158.             break;
  159.         case EditCopy:
  160.                 DoCopy ();        /*    this    */
  161.             break;
  162.         case EditPaste:
  163.                 DoPaste ();        /*    this    */
  164.             break;
  165.         case EditClear:
  166.                 DoClear ();        /*    this    */
  167.             break;
  168.         /*case EditSelectAll:*/
  169. /*                DoSelectAll ();*/
  170. /*            break;*/
  171. /*        case EditCreatePublisher:*/
  172. /*                DoCreatePublisher ();*/
  173. /*            break;*/
  174. /*        case EditSubscribeTo:*/
  175. /*                DoSubscribeTo ();*/
  176. /*            break;*/
  177. /*        case EditSubscriberOptions:*/
  178. /*                DoSubscriberOptions ();*/
  179. /*            break;*/
  180. /*        case EditShowClipboard:*/
  181. /*                DoShowClipboard ();*/
  182. /*            break;*/
  183.         
  184.     } /*switch*/
  185. } /*DoEdit*/
  186.  
  187. /* Edit */
  188.